<?
include_once "gblinclude.lib";

global $gblDBConnect;

$columnName = $_GET["column_name"];
$tableName = $_GET["table_name"];
$value = $_GET["value"];
$type = $_GET["type"];

$res = 0;

try
{
	$sql = "SELECT ".$columnName." FROM ".$tableName." WHERE ".$columnName;
	if ($type == "ATTR_STRING")
		$sql .= "='".$value."'";
	else
		$sql .= "=".$value;
	
	$dataList = $gblDBConnect->getAll($sql);
}
catch(PDOException $ex)
{
	$res = 0;
}

if (count($dataList) > 0)
	$res = 1;

echo json_encode($res);

?>
